﻿using UnityEngine;
using System.Collections;
using DICE_GS;

public class PathSelectIndicator : MonoBehaviour {
	public int boardId;
	public int SID;
	public bool isRatioGoalMax;
	public bool isRatioGoalMin;
	// Use this for initialization
	void Start () {
	
	}
	
	void OnMouseDown()
	{
		Camera.main.gameObject.GetComponent<CameraControl>().PressedUIButton(true);
		UIManager.Instance.CallDelayedPressUp();
        PC_OP_CHOOSE_MOVE_PATH packet = new PC_OP_CHOOSE_MOVE_PATH();

        packet.ServerID = SID;
        packet.CandidateBoardCount = 1;
		packet.BoardIDList = new int[packet.CandidateBoardCount];
		packet.BoardIDList[0] = boardId;
        //CNetworkManager.Instance.SendPacket(packet.Protocol, packet.GetParam());	
		CNetworkManager.Instance.SendPacket(packet);	
		if(isRatioGoalMax)
			HudManager.Instance.ShowAIEmotionChat(BoardManager.Instance.curTurnSID, "wayselect_good");
		else if(isRatioGoalMin)
			HudManager.Instance.ShowAIEmotionChat(BoardManager.Instance.curTurnSID, "wayselect_bad");
		UIManager.Instance.DestroyPathSelectUI(boardId);
		StageManagerWrapper.manager.FindPathToGoal(boardId);
	}

}
